﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArgusLib.Fractals
{
	public class CalculationProgressChangedEventArgs : EventArgs
	{
		public double Progress { get; private set; }
		public TimeSpan ElapsedTime { get; private set; }
		public object[] Data { get; private set; }

		public CalculationProgressChangedEventArgs(double progress, TimeSpan elapsedTime, params object[] data)
			:base()
		{
			this.Progress = progress;
			this.ElapsedTime = elapsedTime;
			this.Data = data;
		}
	}

	public delegate void CalculationProgressChangedEventHandler(IFractal sender, CalculationProgressChangedEventArgs e);

	public class CalculationAbortedEventArgs : EventArgs
	{
		public object[] Data { get; private set; }

		public CalculationAbortedEventArgs(params object[] data)
			: base()
		{
			this.Data = data;
		}
	}

	public delegate void CalculationAbortedEventHandler(IFractal sender, CalculationAbortedEventArgs e);

	public class CalculationFinishedEventArgs : EventArgs
	{
		public TimeSpan ElapsedTime { get; private set; }
		public object[] Data { get; private set; }

		public CalculationFinishedEventArgs(TimeSpan elapsedTime, params object[] data)
			: base()
		{
			this.ElapsedTime = elapsedTime;
			this.Data = data;
		}
	}

	public delegate void CalculationFinishedEventHandler(IFractal sender, CalculationFinishedEventArgs e);

	public class RenderingFinishedEventArgs : EventArgs
	{
		public System.Drawing.Bitmap Image { get; private set; }

		public RenderingFinishedEventArgs(System.Drawing.Bitmap image)
			: base()
		{
			this.Image = image;
		}
	}

	public delegate void RenderingFinishedEventHandler(IRenderer sender, RenderingFinishedEventArgs e);

	public class WarningReceivedEventArgs : EventArgs
	{
		public int Warning { get; private set; }
		public bool Abort { get; set; }

		public WarningReceivedEventArgs(int warning)
			: base()
		{
			this.Warning = warning;
			this.Abort = false;
		}

		public enum Warnings : int
		{
			Unknown,
			MemoryShortage
		}
	}

	public delegate void WarningReceivedEventHandler(IFractal sender, WarningReceivedEventArgs e);
}
